package com.king.juc.syncmode;

import lombok.extern.slf4j.Slf4j;

/**
 * @author king
 * @date 2020/11/5 19:01
 */
@Slf4j(topic = "c.People")
public class People extends Thread {

    @Override
    public void run() {
        // 收件
        GuardedObjectV2 guardedObject = MailBoxes.createGuardedObject();
        log.debug("收件前 id: {}", guardedObject.getId());
        Object mail = guardedObject.getByTimeOut(5000);
        log.debug("收件后 id: {}, 内容: {}", guardedObject.getId(), mail);
    }
}
